<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Logs_model extends MY_Model
{
	function Logs_model()
	{
		parent::MY_Model();
	}
	
	function get_email_log_list($el_type=-1, $el_user=0, $start=1, $limit=20)
	{
		$data = array();
		$result = $this->getRowsOnMultiQuery("CALL selfserving_email_log_getlist($el_type,$el_user,$start,$limit);");
		$data['items'] = $result[0];
		$data['pages'] = (int)$result[1][0]['totalpage'];
		return $data;
	}
	
	function get_users_list()
	{
		return $this->getRows("CALL selfserving_users_getlist();");
	}
	
	function get_inform_list($el_type=-1, $el_user='', $id=0, $el_date='', $start=1, $limit=20)
	{
		$result = $this->getRowsOnMultiQuery("CALL selfserving_get_infom_admin_getlist($el_type,'$el_user', $id,'$el_date',$start,$limit);");
		$data = new stdClass();
		$data->items = $result[0];
		$data->pages = (int)$result[1][0]['totalpage'];
		return $data;
	}
	
	function payment_log_info_by_key($key)
	{
		return $this->getRows("CALL selfserving_get_payment_info_by_key('$key');", false, 'object');
	}
}